package com.wf.day_0612.test2;

/**
 * @author mpk
 * @since 2024/6/12 17:10:13
 */
public class ActTest {


    public static void main(String[] args) {
        Account account = new Account();
        account.setName("零");
        account.setBalance(10000.00);

        new Thread(

                () -> account.withdraw(8000.00)
                , "线程1(synchronized)"

        ).start();
        new Thread(

                () -> account.withdraw(8000.00)
                , "线程2(synchronized)"

        ).start();

       /* new Thread(

                () -> account.withdraw1(8000.00)
                , "线程3(lock)"

        ).start();
        new Thread(

                () -> account.withdraw1(8000.00)
                , "线程4(lock)"

        ).start();*/
    }


}
